<%
Dim Rs,Conn,sConnstr,sPath : sPath = "../DataBase/global.mdb"
Call DBConnBegin(sPath)

'========================================================
'Database Connection Options
'========================================================
Function DbExists(Path,stype) 
        On Error resume Next 
        Dim c : Set c = Server.CreateObject("ADODB.Connection")
		If stype=0 Then
		c.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Path
		Else 
        c.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(Path)
		End If
        If Err.number<>0 Then 
            Err.Clear 
            DbExists = false 
        else 
            DbExists = True 
        End If 
        set c = nothing 
End Function 
	
Sub DBConnBegin(Path)
	If IsObject(Conn) = True Then Exit Sub
	On Error Resume Next
	sConnstr = "Provider=Microsoft.Jet.Oledb.4.0;Data Source="&Server.MapPath(Path) 
	Set Conn = Server.CreateObject("Adodb.Connection") 
	Conn.ConnectionString=sConnstr
	Conn.Open sConnstr
	If Err Then
		Err.Clear
		Conn.Close
		Response.Write("System Error!")
		Response.End()
	End If
	Set Rs=Server.CreateObject("Adodb.Recordset")
End Sub
	
Sub DBConnEnd()
	'On Error Resume Next
	Rs.Close : Set Rs = Nothing
	Conn.Close : Set Conn = Nothing
End Sub
%>